﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Tasks;
using System.Reflection;

namespace PCHenry.miFlashlight
{
	public partial class About : PhoneApplicationPage
	{
		public About()
		{
			InitializeComponent();

			ApplicationInformation applicationInformation = ApplicationInformation.Create();
			VersionTextBlock.Text = applicationInformation.VersionInformation;
		}

		private void ClickHyperlinkButton_Click( object sender, RoutedEventArgs e )
		{
			HyperlinkButton link = sender as HyperlinkButton;
			if( link != null && !string.IsNullOrEmpty( link.Content.ToString() ) )
			{
				WebBrowserTask browser = new WebBrowserTask();
				browser.URL = link.Content.ToString();
				browser.Show();
			}
			else
			{
#if DEBUG
				throw new NullReferenceException( "Calling this method without a HyperLinkButton object and therefore is missing the URL contents to navigate to." );
#endif
			}
		}
	}
}